export const UPDATE_AUTH = (state, auth) => {
    state.auth = auth
}

export const UPDATE_USER = (state, user) => {
    state.user = user
}

export const UPDATE_USER_AVATAR = (state, avatarUrl) => {
    state.user.avatarUrl = avatarUrl
}

export const CLEAR_ALL_DATA = (state) => {
    // Auth
    state.auth.isLoggedIn = false
    state.auth.token = null

    // User
    state.user.Id=''
    state.user.UserName=''
    state.user.Email=''
    state.user.Tel=''
    state.user.Address=''
    state.user.RealName=''
    state.user.Image=''
}

export const UPDATE_TABLE_HEIGHT = (state, tableHeight) => {
    state.tableHeight = tableHeight;
}

export const changeToken = (state, token) => {
    state.auth.token=token
}

export const Login = (state, isLoggedIn) => {
    state.auth.isLoggedIn=isLoggedIn
}

export const WriteUser = (state, user) => {
    state.user=user
}